<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./CSS/reset.css">
    <style>
        table{
            margin: 100px auto;
            width: 800px;
            height: 200px;
            font-size: 12px;
            
        }
        thead{
            /* display: block; */
            background-color: rgba(58, 58, 187, 0.603);
            width: 100%;
        }
        thead tr th{
            height: 25px;
            vertical-align:middle ;
        }
        table tbody tr{
            border-bottom: solid 1px #ccc ;
        }
        table tbody td{
            vertical-align:middle ;
            text-align: center;
            color:rgb(56, 110, 211);
        }
    </style>
</head>

<body>
    <table>
        <thead>
            <tr>
                <th>代码</th>
                <th>名称</th>
                <th>最新公布净值</th>
                <th>累计净值</th>
                <th>前单位净值</th>
                <th>净值增长率</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>003526</td>
                <td>农银金穗3个月定期开放债券</td>
                <td>1.075</td>
                <td>1.079</td>
                <td>1.074</td>
                <td>1.047</td>
            </tr>
            <tr>
                <td>003526</td>
                <td>农银金穗3个月定期开放债券</td>
                <td>1.075</td>
                <td>1.079</td>
                <td>1.074</td>
                <td>1.047</td>
            </tr>
            <tr>
                <td>003526</td>
                <td>农银金穗3个月定期开放债券</td>
                <td>1.075</td>
                <td>1.079</td>
                <td>1.074</td>
                <td>1.047</td>
            </tr>
            <tr>
                <td>003526</td>
                <td>农银金穗3个月定期开放债券</td>
                <td>1.075</td>
                <td>1.079</td>
                <td>1.074</td>
                <td>1.047</td>
            </tr>
            <tr>
                <td>003526</td>
                <td>农银金穗3个月定期开放债券</td>
                <td>1.075</td>
                <td>1.079</td>
                <td>1.074</td>
                <td>1.047</td>
            </tr>
            <tr>
                <td>003526</td>
                <td>农银金穗3个月定期开放债券</td>
                <td>1.075</td>
                <td>1.079</td>
                <td>1.074</td>
                <td>1.047</td>
            </tr>
        </tbody>
        <script>
            //首先获取tbody下的tr
            var trs = document.querySelector('tbody').querySelectorAll('tr');
            //为每一个tr添加鼠标经过事件
            for(var i = 0;i < trs.length;i++){
                trs[i].onmouseover = function(){
                    this.style.backgroundColor = '#bfa';
                }
                trs[i].onmouseout = function(){
                    this.style.backgroundColor = '#fff';
                }
            }
        </script>
    </table>
</body>

</html>